package com.gw.yunke.interceptor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author: zoulei
 * @date: 2018/1/8
 * @description:
 */
//@Configuration
public class CustomWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {

    public static final Logger logger = LoggerFactory.getLogger(CustomWebMvcConfigurerAdapter.class);

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).addPathPatterns("/server/api/opera/**").excludePathPatterns("/server/api/opera/index/**");
        // //对来自** 这个链接来的请求进行拦截
        // registry.addInterceptor(webLogInterceptor()).addPathPatterns("/server/api/opera/**").excludePathPatterns("/server/api/opera/index/**","/server/api/opera/goods/update","/server/api/opera/sms/add/saleinfo");
        // //对来自** 这个链接来的请求进行拦截
        super.addInterceptors(registry);
    }
}
